<?php

session_start();

include_once "src/controller/blmanagement/UserAccountManagement.php";
include_once "src/model/User.php";
include_once "src/misc/ClientReponseGenerator.php";

try {

    $user = UserAccountManagement::getUserById($_POST["userId"]);

    $items = "";
    $items = "{\"username\":\"".$user->getName()."\", \"id\":\"".$user->getUserId()."\", \"password\":\"".$user->getPswd()."\", \"email\":\"".$user->getEmail()."\", \"type\":\"".$user->getType()."\"}";
    

    echo ClientReponseGenerator::jsonResponse(1, $items, "", "");

} catch (Exception $e) {
    echo ClientReponseGenerator::simpleJsonResponse(0, "GetUserAccountException", "");
}

?>
